//
// CDeviceObserver.h
//

#ifndef __H_CDeviceObserver__
#define __H_CDeviceObserver__

#include "CMsgStation.h"
#include "DeviceNotifyDefs.h"

class CDeviceObserver : public CFrameWnd, public CMsgStation
{
protected:
	HDEVNOTIFY						mNotifyHandle;
	PRegisterDeviceNotification		mRegisterDeviceNotification;
	PUnregisterDeviceNotification	mUnregisterDeviceNotification;

	UINT	 mEventType;
	LPBYTE	 mEventData;

	CCritSec mStateLock;

public:
	CDeviceObserver();
	virtual ~CDeviceObserver();

	void Register(void);
	void Unregister(void);

	DECLARE_DYNCREATE(CDeviceObserver)
protected:
// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDeviceObserver)
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CDeviceObserver)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnClose();
	afx_msg BOOL OnDeviceChange(UINT nEventType, DWORD dwData);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#endif // __H_CDeviceObserver__
